home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 17 / CU Amiga Magazine's Super CD-ROM 17 (1997)(EMAP Images)(GB)[!][issue 1997-12].iso / CUCD / Programming / GadUtil / AmigaE / modules / libraries / gadutil.e next >
Text File  |  1997-10-05  |  22KB  |  595 lines

  1. OPT MODULE
  2. OPT EXPORT
  3. OPT PREPROCESS
  4.  
  5. /*------------------------------------------------------------------------**
  6. **
  7. **    $VER: gadutil.h 37.10 (28.09.97)
  8. **
  9. **    Filename:    libraries/gadutil.h
  10. **    Version:    37.10
  11. **    Date:        28-Sep-97
  12. **
  13. **    GadUtil definitions, a dynamic gadget layout system.
  14. **
  15. **    © Copyright 1994-1997 by P-O Yliniemi and Staffan Hämälä.
  16. **
  17. **    All Rights Reserved.
  18. **
  19. **
  20. ** Amiga E module source written by Terje Pedersen
  21. ** Reformatted and updated for GadUtil 37.10 by P-O Yliniemi
  22. **
  23. **------------------------------------------------------------------------*/
  24.  
  25. MODULE 'exec/types','exec/libraries','utility/tagitem','intuition/intuition',
  26.         'graphics/gfxbase','graphics/text','intuition/intuitionbase'
  27.  
  28. /*------------------------------------------------------------------------**
  29. **
  30. ** Extended gadget types available in GadUtil.library.
  31. **
  32. */
  33.  
  34. ENUM     IMAGE_KIND=50,
  35.     LABEL_KIND,
  36.     DRAWER_KIND,
  37.     FILE_KIND,
  38.     BEVELBOX_KIND,
  39.     PROGRESS_KIND
  40.  
  41. /*-------------------- Reserved GadgetID's - don't use! ------------------**
  42. **
  43. ** GadgetID's are really word sized, but two of these vaules are used by the
  44. ** GU_HelpGadget tag, so don't use -1 (65535), -2 (65534) or -3 (65533) as
  45. ** GadgetID!
  46. **
  47. */
  48.  
  49. CONST     GADID_RESERVED=$FFFFFFFF,
  50.     WINTITLE_HELP=$FFFFFFFE,
  51.     SCRTITLE_HELP=$FFFFFFFD
  52.  
  53. /*--------------- Minimum recommended sizes for some gadgets -------------*/
  54. CONST     FILEKIND_WIDTH=20,
  55.     FILEKIND_HEIGHT=14,
  56.  
  57.     DRAWERKIND_WIDTH=20,
  58.     DRAWERKIND_HEIGHT=14
  59.  
  60. /*------------------ Text placement for LABEL_KIND -----------------------**
  61. **
  62. **    ___1_____2_____3___
  63. **    |_____|_____|_____| A    Nine different placements of the text is
  64. **    |_____|_____|_____| B    possible if the size of the box allows it.
  65. **    |_____|_____|_____| C    The flags are the same as for BEVELBOX_KIND
  66. */
  67.  
  68. CONST      LB_TEXT_TOP=0        /* Place text on line A of the box   */
  69. SET    LB_TEXT_MIDDLE,        /* Place text on line B of the box   */
  70.     LB_TEXT_BOTTOM,        /* Place text on line C of the box   */
  71.     LB_TEXT_LEFT,        /* Place text in column 1 of the box */
  72.     LB_TEXT_RIGHT        /* Place text in column 3 of the box */
  73. CONST    LB_TEXT_CENTER=0    /* Place text in column 2 of the box */
  74.  
  75. /*----------------- Alternatives for text placement flags ----------------*/
  76. CONST    LB_TEXT_TOP_CENTER=LB_TEXT_TOP OR LB_TEXT_CENTER,
  77.     LB_TEXT_TOP_LEFT=LB_TEXT_TOP OR LB_TEXT_LEFT,
  78.     LB_TEXT_TOP_RIGHT=LB_TEXT_TOP OR LB_TEXT_RIGHT,
  79.  
  80.     LB_TEXT_MIDDLE_CENTER=LB_TEXT_MIDDLE OR LB_TEXT_CENTER,
  81.     LB_TEXT_MIDDLE_LEFT=LB_TEXT_MIDDLE OR LB_TEXT_LEFT,
  82.     LB_TEXT_MIDDLE_RIGHT=LB_TEXT_MIDDLE OR LB_TEXT_RIGHT,
  83.  
  84.     LB_TEXT_BOTTOM_CENTER=LB_TEXT_BOTTOM OR LB_TEXT_CENTER,
  85.     LB_TEXT_BOTTOM_LEFT=LB_TEXT_BOTTOM OR LB_TEXT_LEFT,
  86.     LB_TEXT_BOTTOM_RIGHT=LB_TEXT_BOTTOM OR LB_TEXT_RIGHT
  87.  
  88. /*---------------------- Text shadow placement flags ---------------------*/
  89. CONST    LB_SHADOW_DR=0,        /* Place the shadow at x+1, y+1   */
  90.      LB_SHADOW_UR=16,    /* Place the shadow at x+1, y-1   */
  91.     LB_SHADOW_DL=32,    /* Place the shadow at x-1, y+1   */
  92.     LB_SHADOW_UL=48        /* Place the shadow at x-1, y-1   */
  93.  
  94. /*------------ Alternatives for text shadow placement flags --------------*/
  95. CONST     LB_SUNAT_UL=0        /* Place the shadow at x+1, y+1   */
  96. CONST     LB_SUNAT_DL=16,        /* Place the shadow at x+1, y-1   */
  97.     LB_SUNAT_UR=32,        /* Place the shadow at x-1, y+1   */
  98.     LB_SUNAT_DR=48,        /* Place the shadow at x-1, y-1   */
  99.  
  100.     LB_3DTEXT=64    /* Alternative to GULB_3DText, TRUE   */
  101.  
  102. /*-------------------------- Bevel box frame types -----------------------*/
  103. ENUM    BFT_BUTTON=0,        /* Normal button bevel box border */
  104.     BFT_RIDGE,        /* STRING_KIND bevel box border   */
  105.     BFT_DROPBOX        /* Icon dropbox type border      */
  106.  
  107. CONST     BFT_HORIZBAR=10        /* Horizontal shadowed line       */
  108. CONST    BFT_VERTBAR=11        /* Vertical shadowed line         */
  109.  
  110. /*------------------ Text placement for BEVELBOX_KIND --------------------*/
  111. ENUM     BB_TEXT_ABOVE=0,    /* Place bevel box text above the
  112.                  * upper border   ___ Example ___ */
  113.  
  114.     BB_TEXT_IN,        /* Place bevel box text centered at
  115.                  * the upper border --- Example --- */
  116.  
  117.     BB_TEXT_BELOW        /* Place bevel box text below the
  118.                  * upper border   ___        ___
  119.                  *                    Example      */
  120.  
  121. CONST     BB_TEXT_CENTER=0,    /* Place the text centered at the
  122.                  * upper border (default)         */
  123.  
  124.     BB_TEXT_LEFT=4,        /* Place the text left adjusted   */
  125.  
  126.     BB_TEXT_RIGHT=8        /* Place the text right adjusted  */
  127.  
  128. /*--------------- Alternatives to text placement flags -------------------*/
  129. CONST    BB_TEXT_ABOVE_CENTER=BB_TEXT_ABOVE OR BB_TEXT_CENTER,
  130.     BB_TEXT_ABOVE_LEFT=BB_TEXT_ABOVE OR BB_TEXT_LEFT,
  131.     BB_TEXT_ABOVE_RIGHT=BB_TEXT_ABOVE OR BB_TEXT_RIGHT,
  132.  
  133.     BB_TEXT_IN_CENTER=BB_TEXT_IN OR BB_TEXT_CENTER,
  134.     BB_TEXT_IN_LEFT=BB_TEXT_IN OR BB_TEXT_LEFT,
  135.     BB_TEXT_IN_RIGHT=BB_TEXT_IN OR BB_TEXT_RIGHT,
  136.  
  137.     BB_TEXT_BELOW_CENTER=BB_TEXT_BELOW OR BB_TEXT_CENTER,
  138.     BB_TEXT_BELOW_LEFT=BB_TEXT_BELOW OR BB_TEXT_LEFT,
  139.     BB_TEXT_BELOW_RIGHT=BB_TEXT_BELOW OR BB_TEXT_RIGHT
  140.  
  141. /*-----------------------Text Shadow placement ---------------------------*/
  142. CONST    BB_SHADOW_DR=0,        /* Place the shadow at x+1, y+1   */
  143.     BB_SHADOW_UR=16,    /* Place the shadow at x+1, y-1   */
  144.     BB_SHADOW_DL=32,    /* Place the shadow at x-1, y+1   */
  145.     BB_SHADOW_UL=48        /* Place the shadow at x-1, y-1   */
  146.  
  147. /*------------------ Alternatives for shadow placement -------------------*/
  148. CONST     BB_SUNAT_UL=0,        /* Place the shadow at x+1, y+1   */
  149.     BB_SUNAT_DL=16,        /* Place the shadow at x+1, y-1   */
  150.     BB_SUNAT_UR=32,        /* Place the shadow at x-1, y+1   */
  151.     BB_SUNAT_DR=48,        /* Place the shadow at x-1, y-1   */
  152.  
  153.     BB_3DTEXT=64        /* Alternative to GUBB_3DText, TRUE */
  154.  
  155. /*------------------------------------------------------------------------**
  156. **
  157. ** This is the structure that actually holds the definition of a single
  158. ** gadget.  It contains the new layout tags defined below, as well as the
  159. ** normal GadTools tags.  You setup all the gadgets in a window by
  160. ** making an array of this structure and passing it to GU_LayoutGadgetsA().
  161. **
  162. */
  163. OBJECT layoutgadget
  164.     lg_GadgetID:INT
  165.     lg_LayoutTags:PTR TO tagitem
  166.     lg_GadToolsTags:PTR TO tagitem
  167.     lg_Gadget:PTR TO gadget
  168. ENDOBJECT
  169.  
  170. /*------------------------------------------------------------------------**
  171. **
  172. ** Structure used to hold the built in strings of a localized program. These
  173. ** strings will be used if we couldn't get a string from the catalog.
  174. **
  175. */
  176. OBJECT appstring
  177.     as_ID                /* String ID              */
  178.     as_Str                /* String pointer          */
  179. ENDOBJECT
  180.  
  181. /*------------------------------------------------------------------------**
  182. **
  183. ** GadUtil.library is basically an extension to Gadtools.library.  It adds
  184. ** to GadTools the ability to dynamically layout gadgets according to the
  185. ** positions of other gadgets, font size, locale, etc. The goal in designing
  186. ** this was to create a system so that programmers could easily create a GUI
  187. ** that automatically adjusted to a user's environment.
  188. **
  189. ** Every gadget is now defined as a TagList, there is no more need to make
  190. ** use of the NewGadget structure as this taglist allows you to access all
  191. ** fields used in that structure. An array of the TagLists for all your
  192. ** window's gadgets is then passed to GU_LayoutGadgetsA() and your gadget
  193. ** list is created.
  194. */
  195.  
  196. CONST    GU_TagBase=TAG_USER + $60000
  197.  
  198. /*********** Define which kind of gadget we are going to have. ************/
  199.  
  200. CONST     GU_GadgetKind=GU_TagBase+1    /* Which kind of gadget to make.  */
  201.  
  202.  
  203. /************************ Gadget width control. ***************************/
  204.  
  205. CONST    GU_Width=GU_TagBase+20,        /* Absolute gadget width.      */
  206.  
  207.     GU_DupeWidth=GU_TagBase+21,    /* Duplicate the width of another
  208.                      * gadget.              */
  209.  
  210.     GU_AutoWidth=GU_TagBase+22,    /* Set width according to length
  211.                      * of text label + ti_Data.       */
  212.  
  213.     GU_Columns=GU_TagBase+23,    /* Set width so that approximately
  214.                      * ti_Data columns will fit.      */
  215.  
  216.     GU_AddWidth=GU_TagBase+24,    /* Add some value to the total
  217.                      * width calculation.          */
  218.  
  219.     GU_MinWidth=GU_TagBase+25,    /* Make sure width is at least this */
  220.  
  221.     GU_MaxWidth=GU_TagBase+26,    /* Make sure width is at most this */
  222.  
  223.     GU_AddWidChar=GU_TagBase+27,    /* Add the width of ti_Data chars
  224.                      *  to the gadget width          */
  225.  
  226.     GU_FractWidth=GU_TagBase+28    /* Divide / multiply gadget width
  227.                      *  with ti_Data          */
  228.  
  229. /************************* Gadget height control. *************************/
  230.  
  231. CONST    GU_Height=GU_TagBase+40,    /* Absolute gadget height.       */
  232.  
  233.     GU_DupeHeight=GU_TagBase+41,    /* Duplicate the height of another
  234.                      * gadget.              */
  235.  
  236.     GU_AutoHeight=GU_TagBase+42,    /* Set height according to height
  237.                      * of text font + ti_Data.      */
  238.  
  239.     GU_HeightFactor=GU_TagBase+43,    /* Make the gadget height a
  240.                      * multiple of the font height.      */
  241.  
  242.     GU_AddHeight=GU_TagBase+44,    /* Add some value to the total
  243.                      * height calculation.          */
  244.  
  245.     GU_MinHeight=GU_TagBase+45,    /* Make sure height is at least this */
  246.  
  247.     GU_MaxHeight=GU_TagBase+46,    /* Make sure height is at most this */
  248.  
  249.     GU_AddHeiLines=GU_TagBase+47,    /* Add the height of ti_Data lines
  250.                      *  to the gadget height      */
  251.  
  252.     GU_FractHeight=GU_TagBase+48    /* Divide / multiply gadget height
  253.                      *  with ti_Data          */
  254.  
  255. /************************* Gadget top edge control. ***********************/
  256.  
  257. CONST     GU_Top=GU_TagBase+60,        /* Absolute top edge.          */
  258.  
  259.     GU_TopRel=GU_TagBase+61,    /* Top edge relative to bottom
  260.                      * edge of another gadget.      */
  261.  
  262.     GU_AddTop=GU_TagBase+62,    /* Add some value to the final
  263.                      * top edge calculation.      */
  264.  
  265.     GU_AlignTop=GU_TagBase+63,    /* Align top edge of gadget with
  266.                      * top edge of another gadget.      */
  267.  
  268.     GU_AdjustTop=GU_TagBase+64,    /* Add the height of the text font
  269.                      * + ti_Data to the top edge.      */
  270.  
  271.     GU_AddTopLines=GU_TagBase+65    /* Add the height of ti_Data lines
  272.                      * to the top edge.          */
  273.  
  274. /*********************** Gadget bottom edge control. **********************/
  275.  
  276. CONST    GU_Bottom=GU_TagBase+80,    /* Absolute bottom edge.      */
  277.  
  278.     GU_BottomRel=GU_TagBase+81,    /* Bottom edge relative to top
  279.                      * edge of another gadget.      */
  280.  
  281.     GU_AddBottom=GU_TagBase+82,    /* Add some value to the final
  282.                      * bottom edge calculation.      */
  283.  
  284.     GU_AlignBottom=GU_TagBase+83,    /* Align bottom edge of gadget with
  285.                      * bottom edge of another gadget. */
  286.  
  287.     GU_AdjustBottom=GU_TagBase+84    /* Subtract the height of the text
  288.                      * font + ti_Data from the top edge */
  289.  
  290. /********************** Gadget left edge control. *************************/
  291.  
  292. CONST     GU_Left=GU_TagBase+100,        /* Absolute left edge.          */
  293.  
  294.     GU_LeftRel=GU_TagBase+101,    /* Left edge relative to right
  295.                      * edge of another gadget.      */
  296.  
  297.     GU_AddLeft=GU_TagBase+102,    /* Add some value to the final
  298.                      * left edge calculation.      */
  299.  
  300.     GU_AlignLeft=GU_TagBase+103,    /* Align left edge of gadget with
  301.                      * left edge of another gadget.      */
  302.  
  303.     GU_AdjustLeft=GU_TagBase+104,    /* Add the width of the text label
  304.                      * + ti_Data to the left edge.      */
  305.  
  306.     GU_AddLeftChar=GU_TagBase+105    /* Add length of ti_Data characters
  307.                      * to the left edge.          */
  308.  
  309. /********************** Gadget right edge control. ************************/
  310.  
  311. CONST    GU_Right=GU_TagBase+120,    /* Absolute right edge.          */
  312.  
  313.     GU_RightRel=GU_TagBase+121,    /* Right edge relative to left
  314.                      * edge of another gadget.      */
  315.  
  316.     GU_AddRight=GU_TagBase+122,    /* Add some value to the final
  317.                      * right edge calculation.      */
  318.  
  319.     GU_AlignRight=GU_TagBase+123,    /* Align right edge of gadget with
  320.                      * right edge of another gadget.  */
  321.  
  322.     GU_AdjustRight=GU_TagBase+124    /* Subtract the width of the text
  323.                      * label + ti_Data from the left edge */
  324.  
  325. /******************************* Other tags *******************************/
  326.  
  327. CONST     GU_ToggleSelect=GU_TagBase+150,    /* Create a toggle-select gadget -
  328.                      * only BUTTON_KIND & IMAGE_KIND  */
  329.  
  330.     GU_Selected=GU_TagBase+151,    /* Set default state of toggle-
  331.                      * select gadget          */
  332.  
  333.     GU_HelpGadget=GU_TagBase+152,    /* Gadget ID of a TEXT_KIND gadget that
  334.                      * will show a short help text */
  335.  
  336.     GU_HelpText=GU_TagBase+153,    /* Pointer to the text to be shown in
  337.                      * the help gadget          */
  338.  
  339.     GU_LocaleHelp=GU_TagBase+154    /* Localized version of GU_HelpText
  340.                       * ti_Data of this tag is the string ID */
  341.  
  342. /********* Access to the other fields of the NewGadget structure **********/
  343.  
  344. CONST     GU_GadgetText=GU_TagBase+160,    /* Gadget label.          */
  345.  
  346.     GU_TextAttr=GU_TagBase+161,    /* Desired font for gadget label. */
  347.  
  348.     GU_Flags=GU_TagBase+162,    /* Gadget flags.          */
  349.  
  350.     GU_UserData=GU_TagBase+163,    /* Gadget UserData.          */
  351.  
  352.     GU_LocaleText=GU_TagBase+164    /* Gadget label taken from a locale. */
  353.  
  354. /************* Tags to store some of the calculated values *****************/
  355.  
  356. CONST    GU_StoreLeft=GU_TagBase+170,    /* Store the gadget's left position */
  357.     GU_StoreTop=GU_TagBase+171,    /* Store the gadget's top position */
  358.     GU_StoreWidth=GU_TagBase+172,    /* Store the gadget's width        */
  359.     GU_StoreHeight=GU_TagBase+173,    /* Store the gadget's height       */
  360.     GU_StoreRight=GU_TagBase+174,    /* Store the gadget's right position */
  361.     GU_StoreBottom=GU_TagBase+175    /* Store the gadget's bottom position */
  362.  
  363. /*************** Tags for GadUtil's extended gadget kinds. *****************/
  364.  
  365. /*---------------------------- IMAGE_KIND tags ---------------------------*/
  366. CONST    GUIM_Image=GU_TagBase+200,    /* Image structure for an image
  367.                      * gadget.              */
  368.  
  369.     GUIM_ReadOnly=GU_TagBase+201,    /* TRUE if read-only.          */
  370.  
  371.     GUIM_SelectImg=GU_TagBase+202,    /* Selected image for IMAGE_KIND
  372.                       * gadgets              */
  373.  
  374.     GUIM_BOOPSILook=GU_TagBase+203    /* Render selected image background
  375.                      * with the fillpen (default = TRUE) */
  376.                      
  377. /*------------------------- BEVELBOX_KIND tags ---------------------------*/
  378. CONST    GUBB_Recessed=GU_TagBase+220,    /* TRUE for a recessed bevel box  */
  379.  
  380.     GUBB_FrameType=GU_TagBase+221,    /* Frame type for bevel box      */
  381.  
  382.     GUBB_TextColor=GU_TagBase+222,    /* Color of the title text      */
  383.  
  384.     GUBB_TextPen=GU_TagBase+223,    /* Pen to print title text with -
  385.                      *  overrides GUBB_TextColor      */
  386.  
  387.     GUBB_Flags=GU_TagBase+224,    /* Text placement flags          */
  388.  
  389.     GUBB_3DText=GU_TagBase+225,    /* Tag to enable 3D text (shadow)
  390.                      *  Not needed if GUBB_ShadowColor
  391.                      *  or GUBB_ShadowPen is used      */
  392.  
  393.     GUBB_ShadowColor=GU_TagBase+226,/* Color of the title text's shadow */
  394.  
  395.     GUBB_ShadowPen=GU_TagBase+227    /* Pen to print the text's shadow
  396.                      *  with - overrides GUBB_ShadowColor */
  397.  
  398. /*-------------------------- LABEL_KIND tags -----------------------------*/
  399. CONST    GULB_TextColor=GU_TagBase+222,    /* Color of the text          */
  400.  
  401.     GULB_TextPen=GU_TagBase+223,    /* Pen to print text with -
  402.                      *  overrides GULB_TextColor      */
  403.  
  404.     GULB_Flags=GU_TagBase+224,    /* Text placement flags          */
  405.  
  406.     GULB_3DText=GU_TagBase+225,    /* Tag to enable 3D text (shadow)
  407.                      *  Not needed if GULB_ShadowColor
  408.                      *  or GULB_ShadowPen is used      */
  409.  
  410.     GULB_ShadowColor=GU_TagBase+226,/* Color of the text's shadow      */
  411.  
  412.     GULB_ShadowPen=GU_TagBase+227    /* Pen to print the text's shadow
  413.                      *  with - overrides GULB_ShadowColor */
  414.  
  415. /*------------------------- PROGRESS_KIND tags ---------------------------*/
  416. CONST    GUPR_FillColor=GU_TagBase+240,    /* Color of filled part of indicator */
  417.  
  418.     GUPR_FillPen=GU_TagBase+241,    /* Pen to fill the indicator with
  419.                      *  - overrides GUPR_FillColor      */
  420.  
  421.     GUPR_BackColor=GU_TagBase+242,    /* Color of the background of the
  422.                      *  indicator              */
  423.  
  424.     GUPR_BackPen=GU_TagBase+243,    /* Pen to use for the indocator's
  425.                      *  background - overrides
  426.                      *  GUPR_BackColor          */
  427.  
  428.     GUPR_Current=GU_TagBase+244,    /* Current value of the indicator */
  429.  
  430.     GUPR_Total=GU_TagBase+245    /* Total value for the indicator  */
  431.  
  432. /************** Tags passed directly to GU_LayoutGadgetsA(). **************/
  433.  
  434. CONST    GU_RightExtreme=GU_TagBase+500,    /* ti_Data is a pointer to a LONG
  435.                      * that is used to store the right-
  436.                      * most point that a gadget
  437.                      * will exist in.        */
  438.  
  439.     GU_LowerExtreme=GU_TagBase+501,    /* ti_Data is a pointer to a LONG
  440.                      * that is used to store the lower-
  441.                      * most point that a gadget will
  442.                      * exist in.              */
  443.  
  444.     GU_Catalog=GU_TagBase+502,    /* Indicates locale for the gadgets. */
  445.  
  446.  
  447.     GU_DefTextAttr=GU_TagBase+503,    /* Specifies a default font for use
  448.                      * with all gadgets, can still be
  449.                      * over-ridden with GU_TextAttr.  */
  450.  
  451.     GU_AppStrings=GU_TagBase+504,    /* Application string table w/IDs. */
  452.  
  453.     GU_BorderLeft=GU_TagBase+505,    /* Size of window left border.      */
  454.  
  455.     GU_BorderTop=GU_TagBase+506,    /* Size of window top border.      */
  456.  
  457.     GU_NoCreate=GU_TagBase+507,    /* Don't actually create the gadgets. */
  458.  
  459.     GU_MinimumIDCMP=GU_TagBase+508,    /* Minimum required IDCMP, so that
  460.                      *  all gadgets will work      */
  461.  
  462.     GU_DefWTitle=GU_TagBase+509,    /* Text to show in window title when
  463.                      *  pointer is outside a gadget with
  464.                      *  help text              */
  465.  
  466.     GU_DefLocWTitle=GU_TagBase+510,    /* Localized default window title */
  467.  
  468.     GU_DefSTitle=GU_TagBase+511,    /* Text to show in screen title when
  469.                      *  pointer is outside a gadget with
  470.                      *  help text              */
  471.  
  472.     GU_DefLocSTitle=GU_TagBase+512,    /* Localized default screen title */
  473.  
  474.     GU_DefHelpText=GU_TagBase+513,    /* Text to show in any gadget used to
  475.                      *  display help text when pointer is
  476.                      *  outside a gadget with help text*/
  477.  
  478.     GU_DefLocHelpText=GU_TagBase+514 /* Localized default help text      */
  479.  
  480. /***************************** Hotkey tags ********************************/
  481.  
  482. CONST GU_Hotkey=GU_TagBase+300        /* Hotkey for gadget (VANILLAKEY) */
  483.  
  484. /********************* Boolean flags for hotkey code **********************/
  485.  
  486. CONST     GU_HotkeyCase=GU_TagBase+301,    /* TRUE for a case-sensitive hotkey */
  487.     GU_LabelHotkey=GU_TagBase+302,    /* TRUE = get hotkey code from label */
  488.     GU_RawKey=GU_TagBase+303    /* TRUE if hotkey is a RAWKEY code */
  489.  
  490. /*********************** Constants for hotkey support *********************/
  491.  
  492. CONST GADUSERMAGIC=$1122        /* Identification for structure that
  493.                      * the gadgets UserData points to */
  494.  
  495. /******************* Public bit numbers for gu_Flags **********************/
  496.  
  497. CONST     GU_HOTKEYCASE=0,        /* Hoykey is case-sensitive      */
  498.       GU_RAWKEY=2            /* gu_Code is a RAWKEY code      */
  499.  
  500. CONST    GU_HOTKEYCASEMASK=1,         /* Mask for GU_HOTKEYCASE bit  */
  501.      GU_RAWKEYMASK=4                /* Mask for GU_RAWKEY bit      */
  502.  
  503. /************** Structure the gadget's UserData points to ******************
  504. *
  505. * This structure is the public part of the allocated data structure for
  506. * hotkeys and IMAGE_KIND gadgets (including FILE_KIND and DRAWER_KIND).
  507. *
  508. * This structure should be considered READ ONLY. The only fields you may
  509. * change is the gu_Code and gu_Flags fields.
  510. *
  511. * DO NOT WRITE ANYTHING BEYOND THIS STRUCTURE WITHOUT ALLOCATING MEMORY FIRST
  512. *
  513. */
  514.  
  515. OBJECT gu_public
  516.     gu_Magic:INT        /* Identification word for structure      */
  517.     gu_GadFlags:LONG    /* Flags for GENERIC kind GadUtil gadgets */
  518.     gu_Flags:CHAR        /* Flags for the hotkey type          */
  519.     gu_Code:CHAR        /* VANILLA or RAWKEY code to react on      */
  520.     gu_Active:INT        /* Active entry for some gadget kinds      */
  521.     gu_MaxVal:INT        /* Maximum value for some gadgets      */
  522.     gu_MinVal:INT        /* Minimum value for some gadgets      */
  523.     gu_GadgetType:LONG    /* Gadget type that was created          */
  524.     gu_HelpGadget:PTR TO gadget    /* Pointer to gadget for help text*/
  525.     gu_HelpText        /* The help text for this gadget      */
  526. ENDOBJECT
  527.  
  528. /*------------------------------------------------------------------------**
  529. **                  Library base                  **
  530. **------------------------------------------------------------------------*/
  531.  
  532. OBJECT gadutilbase
  533.     libnode:PTR TO lib
  534.     gub_Flags:CHAR        /* Private!              */
  535.     gub_Pad:CHAR        /* Private!              */
  536.  
  537.     gadtoolsbase:PTR TO lib    /* The following library bases      */
  538.     gfxbase:PTR TO gfxbase    /* may be read and used by your      */
  539.                 /* program              */
  540.     intuitionbase:PTR TO intuitionbase
  541.     localebase:PTR TO lib    /* LocaleBase may be NULL!      */
  542.     utilitybase:PTR TO lib    
  543.     diskfontbase:PTR TO lib    /* DiskFontBase may be NULL!      */
  544.     gub_segList:LONG    /* Private!              */
  545. ENDOBJECT
  546.  
  547. #define GADUTILNAME    'gadutil.library'
  548. CONST    GADUTIL_VER=37
  549. CONST    GADUTIL_REV=10
  550.  
  551. /*------------------------------------------------------------------------**
  552. **                  BevelBox structure              **
  553. **------------------------------------------------------------------------*/
  554. OBJECT bboxdata
  555.     bbd_XPos:INT             /* X position of box          */
  556.     bbd_YPos:INT             /* Y position of box          */
  557.     bbd_Width:INT            /* Width of box              */
  558.     bbd_Height:INT            /* Height of box          */
  559.  
  560.     bbd_LeftEdge:INT        /* Left edge of text          */
  561.     bbd_TopEdge:INT            /* Top edge of text          */
  562.     bbd_TextWidth:INT        /* Pixel width of text          */
  563.  
  564.     bbd_TextFont:PTR TO textattr    /* Font to print text with      */
  565.     bbd_Text            /* Text to display          */
  566.     bbd_FrontPen:CHAR        /* Text color              */
  567.     bbd_Flags:CHAR            /* Text placement flags          */
  568.     bbd_Recessed:CHAR        /* Recessed frame          */
  569.     bbd_FrameType:CHAR        /* Type of box frame          */
  570.     bbd_ShadowPen:CHAR             /* Shadow color              */
  571.     bbd_Reserved1:CHAR        /* No use in v36.53 - reserved!      */
  572.     bbd_HelpGadget:PTR TO gadget    /* Pointer to gadget for help text*/
  573.     bbd_HelpText            /* The help text for this gadget  */
  574. ENDOBJECT
  575.  
  576. /*------------------------------------------------------------------------**
  577. **              ProgressIndicator structure              **
  578. **------------------------------------------------------------------------*/
  579.  
  580. OBJECT progressgad
  581.     pg_XPos:INT            /* X pos of box around gadget      */
  582.     pg_YPos:INT            /* Y pos of box around gadget      */
  583.     pg_Width:INT            /* Width of box around gadget      */
  584.     pg_Height:INT            /* Height of box around gadget      */
  585.     pg_Current:LONG            /* Current value of indicator      */
  586.     pg_Total:LONG            /* Total value of indicator      */
  587.     pg_FillColor:CHAR        /* Color of upto current value      */
  588.     pg_BackColor:CHAR        /* Color from current to end      */
  589.     pg_Flags:CHAR            /* Flags              */
  590.     pg_reserved1:CHAR
  591.     pg_XFilledTo:INT        /* Initialized to pg_XPos + 4      */
  592.     pg_HelpGadget:PTR TO gadget    /* Pointer to gadget for help text*/
  593.     pg_HelpText            /* The help text for this gadget  */
  594. ENDOBJECT
  595.